package com.hellogood.yaohuo.server.serviceImpl;

import java.util.LinkedHashMap;
import java.util.List;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.hellogood.yaohuo.server.mgr.factory.MgrFactory;
import com.hellogood.yaohuo.shared.entity.Groupqx;
import com.hellogood.yaohuo.shared.services.GroupQxService;

@SuppressWarnings("serial")
public class GroupQxServiceImpl extends RemoteServiceServlet implements GroupQxService {

	@Override
	public String[][] getGroupQx() {
		return MgrFactory.getInstance().createGroupqxMgr().buildGroupQx();
	}

	@Override
	public String addGroupqx(List<Groupqx> qxs) {
		return MgrFactory.getInstance().createGroupqxMgr().addGroupqx(qxs);
	}

	@Override
	public LinkedHashMap<String, Groupqx> getGroupQxListByUserCode(String code) {
		List<Groupqx> list = MgrFactory.getInstance().createGroupqxMgr().getGroupQxListByUsercode(code);
		LinkedHashMap<String, Groupqx> map = new LinkedHashMap<String, Groupqx>();
		if (list != null) {
			for (Groupqx q : list) {
				map.put(q.getMkCode(), q);
			}
		}
		return map;
	}
}
